#include <algorithm>
#include <iostream>
#include <vector>
#define LL long long
using namespace std;

int main() {
  freopen("travel.in", "r", stdin);
  freopen("travel.out", "w", stdout);
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;

  cin >> n;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }

  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += min(a[i], b[i]);
  }
  cout << ans << "\n";
  return 0;
}